<?php namespace App\Http\Requests;

class ResetPasswordByPhone extends Request
{

    public function authorize()
    {
        return true;
    }

    public function attributes()
    {
        return [
            'phone'             => '手机号码',
            'verification_code' => '验证码',
            'password'          => '密码',
        ];
    }

    public function rules()
    {
        return [
            'phone'             => ['required', 'regex:/1\d{10}/', 'exists:users,phone'],
            'verification_code' => 'required',
            'password'          => 'required|min:6|max:255',
        ];
    }


}
